package com.zl.controller;

import com.zl.model.Cat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * 关于Bean作用域demo
 */

@Controller
public class ScopeController {
    @Autowired
    private Cat cat;
    public void doScope(){
        System.out.println("doScopeController");
        System.out.println("源数据: "+cat);
        //修改
        Cat cat2=cat;
        cat2.setName("花花");
        System.out.println("修改后的数据: "+ cat2);
    }

}
